import Vue from 'vue'
import VueRouter from 'vue-router'

import {routes} from './routes'

Vue.use(VueRouter)

const router = new VueRouter({

  mode: 'history',
  routes,
  base: '/',
  routes,
  scrollBehavior(to, from, savedPosition) {
      if (savedPosition && to.meta.keepAlive) {
          return savedPosition;
      }
      return { x: 0, y: 0 };
  },
})

export default router


